//-------------------------------------------------------------------
//	Copyright (c) 2012-2014 Zhirnov Andrey
//	This file is part of the "UXGEN-ES" project.
//	See copyright notice in "Engine.h".
//-------------------------------------------------------------------

#pragma once

#ifdef PLATFORM_SDL

namespace Engine
{
namespace Platforms
{
	
	struct e_sdlkey
	{
		enum type
		{
			_UNKNOWN = 0,

			A = 4,
			B = 5,
			C = 6,
			D = 7,
			E = 8,
			F = 9,
			G = 10,
			H = 11,
			I = 12,
			J = 13,
			K = 14,
			L = 15,
			M = 16,
			N = 17,
			O = 18,
			P = 19,
			Q = 20,
			R = 21,
			S = 22,
			T = 23,
			U = 24,
			V = 25,
			W = 26,
			X = 27,
			Y = 28,
			Z = 29,

			n1 = 30,
			n2 = 31,
			n3 = 32,
			n4 = 33,
			n5 = 34,
			n6 = 35,
			n7 = 36,
			n8 = 37,
			n9 = 38,
			n0 = 39,

			RETURN = 40,
			ESCAPE = 41,
			BACKSPACE = 42,
			TAB = 43,
			SPACE = 44,

			MINUS = 45,
			EQUALS = 46,
			LEFTBRACKET = 47,
			RIGHTBRACKET = 48,
			BACKSLASH = 49,
			NONUSHASH = 50,
			SEMICOLON = 51,
			APOSTROPHE = 52,
			GRAVE = 53,
			COMMA = 54,
			PERIOD = 55,
			SLASH = 56,

			CAPSLOCK = 57,

			F1 = 58,
			F2 = 59,
			F3 = 60,
			F4 = 61,
			F5 = 62,
			F6 = 63,
			F7 = 64,
			F8 = 65,
			F9 = 66,
			F10 = 67,
			F11 = 68,
			F12 = 69,

			PRINTSCREEN = 70,
			SCROLLLOCK = 71,
			PAUSE = 72,
			INSERT = 73,
			HOME = 74,
			PAGEUP = 75,
			DELETE = 76,
			END = 77,
			PAGEDOWN = 78,
			RIGHT = 79,
			LEFT = 80,
			DOWN = 81,
			UP = 82,

			NUMLOCKCLEAR = 83,
			KP_DIVIDE = 84,
			KP_MULTIPLY = 85,
			KP_MINUS = 86,
			KP_PLUS = 87,
			KP_ENTER = 88,
			KP_1 = 89,
			KP_2 = 90,
			KP_3 = 91,
			KP_4 = 92,
			KP_5 = 93,
			KP_6 = 94,
			KP_7 = 95,
			KP_8 = 96,
			KP_9 = 97,
			KP_0 = 98,
			KP_PERIOD = 99,

			NONUSBACKSLASH = 100,
			APPLICATION = 101,
			POWER = 102,
			KP_EQUALS = 103,
			F13 = 104,
			F14 = 105,
			F15 = 106,
			F16 = 107,
			F17 = 108,
			F18 = 109,
			F19 = 110,
			F20 = 111,
			F21 = 112,
			F22 = 113,
			F23 = 114,
			F24 = 115,
			EXECUTE = 116,
			HELP = 117,
			MENU = 118,
			SELECT = 119,
			STOP = 120,
			AGAIN = 121,
			UNDO = 122,
			CUT = 123,
			COPY = 124,
			PASTE = 125,
			FIND = 126,
			MUTE = 127,
			VOLUMEUP = 128,
			VOLUMEDOWN = 129,
			KP_COMMA = 133,
			KP_EQUALSAS400 = 134,

			INTERNATIONAL1 = 135,
			INTERNATIONAL2 = 136,
			INTERNATIONAL3 = 137,
			INTERNATIONAL4 = 138,
			INTERNATIONAL5 = 139,
			INTERNATIONAL6 = 140,
			INTERNATIONAL7 = 141,
			INTERNATIONAL8 = 142,
			INTERNATIONAL9 = 143,
			LANG1 = 144,
			LANG2 = 145,
			LANG3 = 146,
			LANG4 = 147,
			LANG5 = 148,
			LANG6 = 149,
			LANG7 = 150,
			LANG8 = 151,
			LANG9 = 152,

			ALTERASE = 153,
			SYSREQ = 154,
			CANCEL = 155,
			CLEAR = 156,
			PRIOR = 157,
			RETURN2 = 158,
			SEPARATOR = 159,
			//OUT = 160,	// TODO
			OPER = 161,
			CLEARAGAIN = 162,
			CRSEL = 163,
			EXSEL = 164,

			KP_00 = 176,
			KP_000 = 177,
			THOUSANDSSEPARATOR = 178,
			DECIMALSEPARATOR = 179,
			CURRENCYUNIT = 180,
			CURRENCYSUBUNIT = 181,
			KP_LEFTPAREN = 182,
			KP_RIGHTPAREN = 183,
			KP_LEFTBRACE = 184,
			KP_RIGHTBRACE = 185,
			KP_TAB = 186,
			KP_BACKSPACE = 187,
			KP_A = 188,
			KP_B = 189,
			KP_C = 190,
			KP_D = 191,
			KP_E = 192,
			KP_F = 193,
			KP_XOR = 194,
			KP_POWER = 195,
			KP_PERCENT = 196,
			KP_LESS = 197,
			KP_GREATER = 198,
			KP_AMPERSAND = 199,
			KP_DBLAMPERSAND = 200,
			KP_VERTICALBAR = 201,
			KP_DBLVERTICALBAR = 202,
			KP_COLON = 203,
			KP_HASH = 204,
			KP_SPACE = 205,
			KP_AT = 206,
			KP_EXCLAM = 207,
			KP_MEMSTORE = 208,
			KP_MEMRECALL = 209,
			KP_MEMCLEAR = 210,
			KP_MEMADD = 211,
			KP_MEMSUBTRACT = 212,
			KP_MEMMULTIPLY = 213,
			KP_MEMDIVIDE = 214,
			KP_PLUSMINUS = 215,
			KP_CLEAR = 216,
			KP_CLEARENTRY = 217,
			KP_BINARY = 218,
			KP_OCTAL = 219,
			KP_DECIMAL = 220,
			KP_HEXADECIMAL = 221,

			LCTRL = 224,
			LSHIFT = 225,
			LALT = 226,
			LGUI = 227,
			RCTRL = 228,
			RSHIFT = 229,
			RALT = 230,
			RGUI = 231,

			MODE = 257,

			AUDIONEXT = 258,
			AUDIOPREV = 259,
			AUDIOSTOP = 260,
			AUDIOPLAY = 261,
			AUDIOMUTE = 262,
			MEDIASELECT = 263,
			WWW = 264,
			MAIL = 265,
			CALCULATOR = 266,
			COMPUTER = 267,
			AC_SEARCH = 268,
			AC_HOME = 269,
			AC_BACK = 270,
			AC_FORWARD = 271,
			AC_STOP = 272,
			AC_REFRESH = 273,
			AC_BOOKMARKS = 274,

			BRIGHTNESSDOWN = 275,
			BRIGHTNESSUP = 276,
			DISPLAYSWITCH = 277,
			KBDILLUMTOGGLE = 278,
			KBDILLUMDOWN = 279,
			KBDILLUMUP = 280,
			EJECT = 281,
			SLEEP = 282,

			APP1 = 283,
			APP2 = 284,

			_COUNT = 512
		};
	};



	// Android Emulation
	struct EKey
	{
		enum type
		{
			_UNKNOWN		= e_sdlkey::_UNKNOWN,

			// arrows
			DPAD_UP			= e_sdlkey::UP,
			DPAD_DOWN		= e_sdlkey::DOWN,
			DPAD_LEFT		= e_sdlkey::LEFT,
			DPAD_RIGHT		= e_sdlkey::RIGHT,
			DPAD_CENTER		= e_sdlkey::KP_5,
			
			// phone
			CALL			= e_sdlkey::F1,
			ENDCALL			= e_sdlkey::F2,
			CAMERA			= e_sdlkey::F3,
			SOFT_LEFT		= e_sdlkey::LCTRL,
			SOFT_RIGHT		= e_sdlkey::RCTRL,
			STAR			= e_sdlkey::F4,				// * 
			POUND			= e_sdlkey::F5,				// # 

			// numbers
			n0				= e_sdlkey::n0,
			n1				= e_sdlkey::n1,
			n2				= e_sdlkey::n2,
			n3				= e_sdlkey::n3,
			n4				= e_sdlkey::n4,
			n5				= e_sdlkey::n5,
			n6				= e_sdlkey::n6,
			n7				= e_sdlkey::n7,
			n8				= e_sdlkey::n8,
			n9				= e_sdlkey::n9,

			// chars
			A				= e_sdlkey::A,
			B				= e_sdlkey::B,
			C				= e_sdlkey::C,
			D				= e_sdlkey::D,
			E				= e_sdlkey::E,
			F				= e_sdlkey::F,
			G				= e_sdlkey::G,
			H				= e_sdlkey::H,
			I				= e_sdlkey::I,
			J				= e_sdlkey::J,
			K				= e_sdlkey::K,
			L				= e_sdlkey::L,
			M				= e_sdlkey::M,
			N				= e_sdlkey::N,
			O				= e_sdlkey::O,
			P				= e_sdlkey::P,
			Q				= e_sdlkey::Q,
			R				= e_sdlkey::R,
			S				= e_sdlkey::S,
			T				= e_sdlkey::T,
			U				= e_sdlkey::U,
			V				= e_sdlkey::V,
			W				= e_sdlkey::W,
			X				= e_sdlkey::X,
			Y				= e_sdlkey::Y,
			Z				= e_sdlkey::Z,

			// symbols
			COMMA			= e_sdlkey::COMMA,			// , 
			PERIOD			= e_sdlkey::PERIOD,			// . 
			TAB				= e_sdlkey::TAB,
			SPACE			= e_sdlkey::SPACE,
			GRAVE			= e_sdlkey::GRAVE,			// ` (~)
			MINUS			= e_sdlkey::MINUS,			// - 
			EQUALS			= e_sdlkey::EQUALS,			// = 
			BACKSLASH		= e_sdlkey::BACKSLASH,		// / 
			SEMICOLON		= e_sdlkey::SEMICOLON,		// ; 
			APOSTROPHE		= e_sdlkey::APOSTROPHE,		// ' 
			SLASH			= e_sdlkey::SLASH,			// \ 
			PLUS			= e_sdlkey::KP_PLUS,		// +
			LEFT_BRACKET	= e_sdlkey::LEFTBRACKET,	// [
			RIGHT_BRACKET	= e_sdlkey::RIGHTBRACKET,	// ]

			// edit
			DEL				= e_sdlkey::DELETE,
			ENTER			= e_sdlkey::RETURN,

			// controls
			ALT_LEFT		= e_sdlkey::LALT,
			ALT_RIGHT		= e_sdlkey::RALT,
			SHIFT_LEFT		= e_sdlkey::LSHIFT,
			SHIFT_RIGHT		= e_sdlkey::RSHIFT,
			
			// system
			POWER			= e_sdlkey::SLEEP,
			CLEAR			= e_sdlkey::CLEAR,
			SYM				= e_sdlkey::F8,
			EXPLORER		= e_sdlkey::F9,
			ENVELOPE		= e_sdlkey::F10,
			AT				= e_sdlkey::F11,
			NUM				= e_sdlkey::NUMLOCKCLEAR,
			HEADSETHOOK		= e_sdlkey::F12,
			FOCUS			= e_sdlkey::F6,
			MENU			= e_sdlkey::MENU,
			NOTIFICATION	= e_sdlkey::F7,
			SEARCH			= e_sdlkey::AC_SEARCH,
			HOME			= e_sdlkey::HOME,
			BACK			= e_sdlkey::ESCAPE,
			PAGE_UP			= e_sdlkey::PAGEUP,
			PAGE_DOWN		= e_sdlkey::PAGEDOWN,
			PICTSYMBOLS		= e_sdlkey::PRINTSCREEN,	// == Print Screen
			SWITCH_CHARSET	= e_sdlkey::PAUSE,
			
			// media
			MEDIA_PLAY		= e_sdlkey::AUDIOPLAY,
			MEDIA_STOP		= e_sdlkey::AUDIOSTOP,
			MEDIA_NEXT		= e_sdlkey::AUDIONEXT,
			MEDIA_PREVIOUS	= e_sdlkey::AUDIOPREV,
			MEDIA_REWIND	= e_sdlkey::F13,
			MEDIA_FORWARD	= e_sdlkey::F14,
			MEDIA_MUTE		= e_sdlkey::AUDIOMUTE,

			// volume
			VOLUME_UP		= e_sdlkey::VOLUMEUP,
			VOLUME_DOWN		= e_sdlkey::VOLUMEDOWN,
			
			// unknown
			BUTTON_A		= 0,
			BUTTON_B		= 0,
			BUTTON_C		= 0,
			BUTTON_X		= 0,
			BUTTON_Y		= 0,
			BUTTON_Z		= 0,
			BUTTON_L1		= 0,
			BUTTON_R1		= 0,
			BUTTON_L2		= 0,
			BUTTON_R2		= 0,
			BUTTON_THUMBL	= 0,
			BUTTON_THUMBR	= 0,
			BUTTON_START	= 0,
			BUTTON_SELECT	= 0,
			BUTTON_MODE		= 0,

			_COUNT			= e_sdlkey::_COUNT
		};
	};


}	// Platforms
}	// Engine

#endif	// PLATFORM_SDL